package com.boarsoft.dao.sharding.datasource;

import com.boarsoft.dao.sharding.util.MappingUtil;

public class SimpleMapDataSource extends DynamicDataSource {
	@Override
	public String match(String key) {
		if (map.containsKey(key)) {
			return map.get(key);
		}
		String k = MappingUtil.simpleMatch(map.keySet(), key);
		k = (k == null ? _default : map.get(k));
		this.put(key, k);
		return k;
	}
}